package friendsbtt.utils;

import friendsbtt.core.lang.CustomList;
import friendsbtt.core.services.IGalleryWebClient;

public class Gallery implements IGallery {

	private IGalleryWebClient webClient;
	
	private CustomList<IAlbum> albums;
	
	public Gallery(IGalleryWebClient webClient){
		this.webClient = webClient;
	}
	
	@Override
	public CustomList<IAlbum> getAlbums()  {
		if(albums == null){
			setAlbums();
		}
		return albums;
	}
	
	private void setAlbums(){
		try {
			this.albums = webClient.getAlbums();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
